home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-2.iso / Files II / Prog / H-K / HexEdit1.05.sit / HexEditSource / Source / Main.c < prev    next >
MacBinary  |  1993-12-13  |  10.1 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Dec 13 11:02:57 1993, modified Mon Dec 13 11:02:57 1993, creator Think C, type ASCII, 9596 bytes "Main.c" , at 0x25fc 550 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-4K) default (weak)
16% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 4d 61 69 6e 2e 63 | 00 00 00 00 00 00 00 00 |..Main.c|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 25 7c 00 | 00 02 26 a9 32 42 b1 a9 |.....%|.|..&.2B..|
|00000060| 32 42 b1 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |2B......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 36 0a 00 00 |........|....6...|
|00000080| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00000090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000d0| 2a 2a 2a 2a 2a 0d 20 2a | 20 4d 61 69 6e 2e 63 0d |*****. *| Main.c.|
|000000e0| 20 2a 0d 20 2a 20 66 72 | 6f 6d 20 48 65 78 45 64 | *. * fr|om HexEd|
|000000f0| 69 74 2c 20 61 20 73 69 | 6d 70 6c 65 20 68 65 78 |it, a si|mple hex|
|00000100| 20 65 64 69 74 6f 72 0d | 20 2a 20 63 6f 70 79 72 | editor.| * copyr|
|00000110| 69 67 68 74 20 31 39 39 | 33 2c 20 4a 69 6d 20 42 |ight 199|3, Jim B|
|00000120| 75 6d 67 61 72 64 6e 65 | 72 0d 20 2a 0d 20 2a 20 |umgardne|r. *. * |
|00000130| 52 65 76 69 73 69 6f 6e | 20 48 69 73 74 6f 72 79 |Revision| History|
|00000140| 20 69 73 20 69 6e 20 48 | 69 73 74 6f 72 79 2e 6e | is in H|istory.n|
|00000150| 6f 74 65 0d 20 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |ote. ***|********|
|00000160| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000170| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000180| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000190| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2f 0d 23 69 6e 63 6c |********|*/.#incl|
|000001b0| 75 64 65 20 22 48 65 78 | 45 64 69 74 2e 68 22 0d |ude "Hex|Edit.h".|
|000001c0| 23 69 6e 63 6c 75 64 65 | 20 22 41 70 70 6c 65 45 |#include| "AppleE|
|000001d0| 76 65 6e 74 73 2e 68 22 | 0d 23 69 6e 63 6c 75 64 |vents.h"|.#includ|
|000001e0| 65 20 3c 54 72 61 70 73 | 2e 68 3e 0d 0d 0d 76 6f |e <Traps|.h>...vo|
|000001f0| 69 64 20 09 4d 79 49 6e | 69 74 4d 61 63 69 6e 74 |id .MyIn|itMacint|
|00000200| 6f 73 68 28 76 6f 69 64 | 29 3b 0d 76 6f 69 64 09 |osh(void|);.void.|
|00000210| 4d 79 49 6e 69 74 4d 75 | 6c 74 69 66 69 6e 64 65 |MyInitMu|ltifinde|
|00000220| 72 28 76 6f 69 64 29 3b | 0d 76 6f 69 64 20 09 49 |r(void);|.void .I|
|00000230| 6e 69 74 41 70 70 6c 65 | 45 76 65 6e 74 73 28 76 |nitApple|Events(v|
|00000240| 6f 69 64 29 3b 0d 76 6f | 69 64 09 43 68 65 63 6b |oid);.vo|id.Check|
|00000250| 45 6e 76 69 72 6f 6e 6d | 65 6e 74 28 76 6f 69 64 |Environm|ent(void|
|00000260| 29 3b 0d 76 6f 69 64 20 | 09 4d 79 48 61 6e 64 6c |);.void |.MyHandl|
|00000270| 65 45 76 65 6e 74 28 76 | 6f 69 64 29 3b 0d 76 6f |eEvent(v|oid);.vo|
|00000280| 69 64 20 09 4d 79 44 6f | 45 76 65 6e 74 28 45 76 |id .MyDo|Event(Ev|
|00000290| 65 6e 74 52 65 63 6f 72 | 64 20 2a 74 68 65 45 76 |entRecor|d *theEv|
|000002a0| 65 6e 74 29 3b 0d 76 6f | 69 64 09 49 64 6c 65 4f |ent);.vo|id.IdleO|
|000002b0| 62 6a 65 63 74 73 28 45 | 76 65 6e 74 52 65 63 6f |bjects(E|ventReco|
|000002c0| 72 64 20 2a 65 72 29 3b | 0d 0d 42 6f 6f 6c 65 61 |rd *er);|..Boolea|
|000002d0| 6e 09 67 57 4e 45 49 6d | 70 6c 65 6d 65 6e 74 65 |n.gWNEIm|plemente|
|000002e0| 64 2c 67 51 75 69 74 46 | 6c 61 67 2c 67 53 79 73 |d,gQuitF|lag,gSys|
|000002f0| 37 46 6c 61 67 2c 67 43 | 6f 6c 6f 72 51 44 46 6c |7Flag,gC|olorQDFl|
|00000300| 61 67 3b 0d 2f 2f 20 54 | 79 70 69 63 61 6c 20 4d |ag;.// T|ypical M|
|00000310| 61 63 69 6e 74 6f 73 68 | 20 49 6e 69 74 69 61 6c |acintosh| Initial|
|00000320| 69 7a 61 74 69 6f 6e 20 | 43 6f 64 65 0d 0d 0d 2f |ization |Code.../|
|00000330| 2f 20 4d 61 69 6e 20 45 | 6e 74 72 79 20 50 6f 69 |/ Main E|ntry Poi|
|00000340| 6e 74 0d 0d 6d 61 69 6e | 28 29 0d 7b 0d 09 2f 2f |nt..main|().{..//|
|00000350| 20 53 74 61 6e 64 61 72 | 64 20 4d 61 63 20 49 6e | Standar|d Mac In|
|00000360| 69 74 69 61 6c 69 7a 61 | 74 69 6f 6e 0d 09 4d 79 |itializa|tion..My|
|00000370| 49 6e 69 74 4d 61 63 69 | 6e 74 6f 73 68 28 29 3b |InitMaci|ntosh();|
|00000380| 0d 0d 09 2f 2f 20 43 68 | 65 63 6b 20 69 66 20 4d |...// Ch|eck if M|
|00000390| 75 6c 74 69 66 69 6e 64 | 65 72 20 28 57 61 69 74 |ultifind|er (Wait|
|000003a0| 4e 65 78 74 45 76 65 6e | 74 29 20 69 73 20 69 6d |NextEven|t) is im|
|000003b0| 70 6c 65 6d 65 6e 74 65 | 64 0d 09 4d 79 49 6e 69 |plemente|d..MyIni|
|000003c0| 74 4d 75 6c 74 69 66 69 | 6e 64 65 72 28 29 3b 0d |tMultifi|nder();.|
|000003d0| 0d 09 2f 2f 20 43 68 65 | 63 6b 20 69 66 20 53 79 |..// Che|ck if Sy|
|000003e0| 73 74 65 6d 20 37 0d 09 | 43 68 65 63 6b 45 6e 76 |stem 7..|CheckEnv|
|000003f0| 69 72 6f 6e 6d 65 6e 74 | 28 29 3b 0d 0d 09 2f 2f |ironment|();...//|
|00000400| 20 49 6e 69 74 20 41 70 | 70 6c 65 20 45 76 65 6e | Init Ap|ple Even|
|00000410| 74 73 0d 09 49 6e 69 74 | 41 70 70 6c 65 45 76 65 |ts..Init|AppleEve|
|00000420| 6e 74 73 28 29 3b 0d 0d | 09 2f 2f 20 53 65 74 20 |nts();..|.// Set |
|00000430| 75 70 20 74 68 65 20 6d | 65 6e 75 20 62 61 72 0d |up the m|enu bar.|
|00000440| 09 4d 79 53 65 74 55 70 | 4d 65 6e 75 73 28 29 3b |.MySetUp|Menus();|
|00000450| 0d 0d 09 49 6e 69 74 69 | 61 6c 69 7a 65 45 64 69 |...Initi|alizeEdi|
|00000460| 74 6f 72 28 29 3b 0d 0d | 09 69 66 20 28 21 67 53 |tor();..|.if (!gS|
|00000470| 79 73 37 46 6c 61 67 29 | 0d 09 09 41 73 6b 45 64 |ys7Flag)|...AskEd|
|00000480| 69 74 57 69 6e 64 6f 77 | 28 29 3b 0d 0d 09 2f 2f |itWindow|();...//|
|00000490| 20 6d 61 69 6e 20 65 76 | 65 6e 74 20 6c 6f 6f 70 | main ev|ent loop|
|000004a0| 0d 09 77 68 69 6c 65 20 | 28 21 67 51 75 69 74 46 |..while |(!gQuitF|
|000004b0| 6c 61 67 29 09 09 09 2f | 2f 20 54 69 6c 6c 20 74 |lag).../|/ Till t|
|000004c0| 68 65 20 45 6e 64 20 6f | 66 20 54 69 6d 65 2e 2e |he End o|f Time..|
|000004d0| 2e 0d 09 09 4d 79 48 61 | 6e 64 6c 65 45 76 65 6e |....MyHa|ndleEven|
|000004e0| 74 28 29 3b 09 09 2f 2f | 20 47 65 74 20 61 6e 20 |t();..//| Get an |
|000004f0| 45 76 65 6e 74 2c 20 64 | 6f 20 73 6f 6d 65 74 68 |Event, d|o someth|
|00000500| 69 6e 67 20 61 62 6f 75 | 74 20 69 74 0d 0d 09 43 |ing abou|t it...C|
|00000510| 6c 65 61 6e 75 70 45 64 | 69 74 6f 72 28 29 3b 0d |leanupEd|itor();.|
|00000520| 7d 0d 0d 2f 2f 20 53 74 | 61 6e 64 61 72 64 20 4d |}..// St|andard M|
|00000530| 61 63 69 6e 74 6f 73 68 | 20 49 6e 69 74 69 61 6c |acintosh| Initial|
|00000540| 69 7a 61 74 69 6f 6e 0d | 0d 76 6f 69 64 20 4d 79 |ization.|.void My|
|00000550| 49 6e 69 74 4d 61 63 69 | 6e 74 6f 73 68 28 76 6f |InitMaci|ntosh(vo|
|00000560| 69 64 29 0d 7b 0d 09 4d | 61 78 41 70 70 6c 5a 6f |id).{..M|axApplZo|
|00000570| 6e 65 28 29 3b 0d 09 0d | 09 49 6e 69 74 47 72 61 |ne();...|.InitGra|
|00000580| 66 28 26 74 68 65 50 6f | 72 74 29 3b 0d 09 49 6e |f(&thePo|rt);..In|
|00000590| 69 74 46 6f 6e 74 73 28 | 29 3b 0d 09 46 6c 75 73 |itFonts(|);..Flus|
|000005a0| 68 45 76 65 6e 74 73 28 | 65 76 65 72 79 45 76 65 |hEvents(|everyEve|
|000005b0| 6e 74 2c 20 30 29 3b 0d | 09 49 6e 69 74 57 69 6e |nt, 0);.|.InitWin|
|000005c0| 64 6f 77 73 28 29 3b 0d | 09 49 6e 69 74 4d 65 6e |dows();.|.InitMen|
|000005d0| 75 73 28 29 3b 0d 09 54 | 45 49 6e 69 74 28 29 3b |us();..T|EInit();|
|000005e0| 0d 09 49 6e 69 74 44 69 | 61 6c 6f 67 73 28 30 4c |..InitDi|alogs(0L|
|000005f0| 29 3b 0d 09 49 6e 69 74 | 43 75 72 73 6f 72 28 29 |);..Init|Cursor()|
|00000600| 3b 0d 7d 0d 0d 2f 2f 20 | 43 68 65 63 6b 20 69 66 |;.}..// |Check if|
|00000610| 20 57 61 69 74 4e 65 78 | 74 45 76 65 6e 74 20 28 | WaitNex|tEvent (|
|00000620| 4d 75 6c 74 69 66 69 6e | 64 65 72 29 20 69 73 20 |Multifin|der) is |
|00000630| 69 6d 70 6c 65 6d 65 6e | 74 65 64 20 6f 6e 20 74 |implemen|ted on t|
|00000640| 68 69 73 20 4d 61 63 69 | 6e 74 6f 73 68 0d 0d 76 |his Maci|ntosh..v|
|00000650| 6f 69 64 20 4d 79 49 6e | 69 74 4d 75 6c 74 69 66 |oid MyIn|itMultif|
|00000660| 69 6e 64 65 72 28 76 6f | 69 64 29 0d 7b 0d 09 67 |inder(vo|id).{..g|
|00000670| 57 4e 45 49 6d 70 6c 65 | 6d 65 6e 74 65 64 20 3d |WNEImple|mented =|
|00000680| 20 28 4e 47 65 74 54 72 | 61 70 41 64 64 72 65 73 | (NGetTr|apAddres|
|00000690| 73 28 5f 57 61 69 74 4e | 65 78 74 45 76 65 6e 74 |s(_WaitN|extEvent|
|000006a0| 2c 20 54 6f 6f 6c 54 72 | 61 70 29 20 21 3d 20 0d |, ToolTr|ap) != .|
|000006b0| 09 09 09 09 09 20 20 20 | 4e 47 65 74 54 72 61 70 |..... |NGetTrap|
|000006c0| 41 64 64 72 65 73 73 28 | 5f 55 6e 69 6d 70 6c 65 |Address(|_Unimple|
|000006d0| 6d 65 6e 74 65 64 2c 54 | 6f 6f 6c 54 72 61 70 29 |mented,T|oolTrap)|
|000006e0| 29 3b 0d 7d 0d 0d 2f 2f | 20 54 68 65 20 4d 61 69 |);.}..//| The Mai|
|000006f0| 6e 20 45 76 65 6e 74 20 | 44 69 73 70 61 74 63 68 |n Event |Dispatch|
|00000700| 65 72 20 2d 20 74 68 69 | 73 20 72 6f 75 74 69 6e |er - thi|s routin|
|00000710| 65 20 73 68 6f 75 6c 64 | 20 62 65 20 63 61 6c 6c |e should| be call|
|00000720| 65 64 20 72 65 70 65 61 | 74 65 64 6c 79 0d 0d 76 |ed repea|tedly..v|
|00000730| 6f 69 64 20 4d 79 48 61 | 6e 64 6c 65 45 76 65 6e |oid MyHa|ndleEven|
|00000740| 74 28 76 6f 69 64 29 0d | 0d 7b 0d 09 45 76 65 6e |t(void).|.{..Even|
|00000750| 74 52 65 63 6f 72 64 09 | 74 68 65 45 76 65 6e 74 |tRecord.|theEvent|
|00000760| 3b 0d 09 42 6f 6f 6c 65 | 61 6e 09 09 6f 6b 3b 0d |;..Boole|an..ok;.|
|00000770| 0d 09 2f 2f 20 49 66 20 | 74 68 65 20 6d 6f 72 65 |..// If |the more|
|00000780| 20 6d 6f 64 65 72 6e 20 | 57 61 69 74 4e 65 78 74 | modern |WaitNext|
|00000790| 45 76 65 6e 74 20 69 73 | 20 69 6d 70 6c 65 6d 65 |Event is| impleme|
|000007a0| 6e 74 65 64 2c 20 75 73 | 65 20 69 74 20 0d 0d 09 |nted, us|e it ...|
|000007b0| 69 66 20 28 67 57 4e 45 | 49 6d 70 6c 65 6d 65 6e |if (gWNE|Implemen|
|000007c0| 74 65 64 29 0d 09 09 2f | 2f 20 57 65 20 64 6f 6e |ted).../|/ We don|
|000007d0| 27 74 20 68 61 76 65 20 | 74 6f 20 63 61 6c 6c 20 |'t have |to call |
|000007e0| 53 79 73 74 65 6d 54 61 | 73 6b 20 62 65 63 61 75 |SystemTa|sk becau|
|000007f0| 73 65 20 57 61 69 74 4e | 65 78 74 45 76 65 6e 74 |se WaitN|extEvent|
|00000800| 20 63 61 6c 6c 73 20 69 | 74 20 66 6f 72 20 75 73 | calls i|t for us|
|00000810| 0d 09 09 2f 2f 20 47 65 | 74 20 74 68 65 20 6e 65 |...// Ge|t the ne|
|00000820| 78 74 20 65 76 65 6e 74 | 0d 09 09 6f 6b 20 3d 20 |xt event|...ok = |
|00000830| 57 61 69 74 4e 65 78 74 | 45 76 65 6e 74 28 65 76 |WaitNext|Event(ev|
|00000840| 65 72 79 45 76 65 6e 74 | 2c 26 74 68 65 45 76 65 |eryEvent|,&theEve|
|00000850| 6e 74 2c 30 4c 2c 4e 55 | 4c 4c 29 3b 0d 0d 09 65 |nt,0L,NU|LL);...e|
|00000860| 6c 73 65 20 7b 0d 09 09 | 2f 2f 20 77 65 20 61 72 |lse {...|// we ar|
|00000870| 65 20 72 75 6e 6e 69 6e | 67 20 69 6e 20 28 53 69 |e runnin|g in (Si|
|00000880| 6e 67 6c 65 29 20 46 69 | 6e 64 65 72 20 75 6e 64 |ngle) Fi|nder und|
|00000890| 65 72 20 73 79 73 74 65 | 6d 20 36 20 6f 72 20 6c |er syste|m 6 or l|
|000008a0| 65 73 73 0d 09 09 2f 2f | 20 47 69 76 65 20 44 65 |ess...//| Give De|
|000008b0| 73 6b 20 41 63 63 65 73 | 73 6f 72 69 65 73 20 73 |sk Acces|sories s|
|000008c0| 6f 6d 65 20 70 72 6f 63 | 65 73 73 69 6e 67 20 74 |ome proc|essing t|
|000008d0| 69 6d 65 0d 09 09 53 79 | 73 74 65 6d 54 61 73 6b |ime...Sy|stemTask|
|000008e0| 20 28 29 3b 0d 0d 09 09 | 2f 2f 20 47 65 74 20 74 | ();....|// Get t|
|000008f0| 68 65 20 6e 65 78 74 20 | 65 76 65 6e 74 0d 09 09 |he next |event...|
|00000900| 6f 6b 20 3d 20 47 65 74 | 4e 65 78 74 45 76 65 6e |ok = Get|NextEven|
|00000910| 74 20 28 65 76 65 72 79 | 45 76 65 6e 74 2c 20 26 |t (every|Event, &|
|00000920| 74 68 65 45 76 65 6e 74 | 29 3b 0d 09 7d 0d 0d 09 |theEvent|);..}...|
|00000930| 69 66 20 28 49 73 44 69 | 61 6c 6f 67 45 76 65 6e |if (IsDi|alogEven|
|00000940| 74 28 26 74 68 65 45 76 | 65 6e 74 29 29 20 7b 0d |t(&theEv|ent)) {.|
|00000950| 09 09 44 6f 4d 6f 64 65 | 6c 65 73 73 44 69 61 6c |..DoMode|lessDial|
|00000960| 6f 67 45 76 65 6e 74 28 | 26 74 68 65 45 76 65 6e |ogEvent(|&theEven|
|00000970| 74 29 3b 0d 09 7d 0d 09 | 65 6c 73 65 20 69 66 20 |t);..}..|else if |
|00000980| 28 6f 6b 29 20 7b 0d 09 | 09 09 2f 2f 20 48 61 6e |(ok) {..|..// Han|
|00000990| 64 6c 65 20 74 68 65 20 | 45 76 65 6e 74 0d 09 09 |dle the |Event...|
|000009a0| 09 4d 79 44 6f 45 76 65 | 6e 74 28 26 74 68 65 45 |.MyDoEve|nt(&theE|
|000009b0| 76 65 6e 74 29 3b 0d 09 | 7d 0d 09 65 6c 73 65 20 |vent);..|}..else |
|000009c0| 7b 0d 09 09 2f 2f 20 4e | 6f 74 68 69 6e 67 20 68 |{...// N|othing h|
|000009d0| 61 70 70 65 6e 65 64 2c | 20 6b 69 63 6b 20 62 61 |appened,| kick ba|
|000009e0| 63 6b 2e 2e 2e 0d 09 09 | 49 64 6c 65 4f 62 6a 65 |ck......|IdleObje|
|000009f0| 63 74 73 28 26 74 68 65 | 45 76 65 6e 74 29 3b 0d |cts(&the|Event);.|
|00000a00| 09 7d 0d 7d 0d 0d 0d 76 | 6f 69 64 20 4d 79 44 6f |.}.}...v|oid MyDo|
|00000a10| 45 76 65 6e 74 28 45 76 | 65 6e 74 52 65 63 6f 72 |Event(Ev|entRecor|
|00000a20| 64 20 2a 74 68 65 45 76 | 65 6e 74 29 0d 7b 0d 09 |d *theEv|ent).{..|
|00000a30| 73 68 6f 72 74 20 09 09 | 77 69 6e 64 6f 77 43 6f |short ..|windowCo|
|00000a40| 64 65 3b 0d 09 57 69 6e | 64 6f 77 50 74 72 09 74 |de;..Win|dowPtr.t|
|00000a50| 68 65 57 69 6e 64 6f 77 | 3b 0d 0d 0d 09 73 77 69 |heWindow|;....swi|
|00000a60| 74 63 68 20 28 74 68 65 | 45 76 65 6e 74 2d 3e 77 |tch (the|Event->w|
|00000a70| 68 61 74 29 20 7b 0d 09 | 2f 2f 0d 09 2f 2f 20 57 |hat) {..|//..// W|
|00000a80| 61 73 20 74 68 65 20 6d | 6f 75 73 65 20 62 75 74 |as the m|ouse but|
|00000a90| 74 6f 6e 20 70 72 65 73 | 73 65 64 3f 0d 09 63 61 |ton pres|sed?..ca|
|00000aa0| 73 65 20 6d 6f 75 73 65 | 44 6f 77 6e 3a 0d 09 09 |se mouse|Down:...|
|00000ab0| 2f 2f 20 46 69 6e 64 20 | 6f 75 74 20 77 68 65 72 |// Find |out wher|
|00000ac0| 65 20 74 68 65 20 6d 6f | 75 73 65 20 77 65 6e 74 |e the mo|use went|
|00000ad0| 20 64 6f 77 6e 0d 09 09 | 77 69 6e 64 6f 77 43 6f | down...|windowCo|
|00000ae0| 64 65 20 3d 20 46 69 6e | 64 57 69 6e 64 6f 77 20 |de = Fin|dWindow |
|00000af0| 28 74 68 65 45 76 65 6e | 74 2d 3e 77 68 65 72 65 |(theEven|t->where|
|00000b00| 2c 20 26 74 68 65 57 69 | 6e 64 6f 77 29 3b 0d 0d |, &theWi|ndow);..|
|00000b10| 09 20 20 09 73 77 69 74 | 63 68 20 28 77 69 6e 64 |. .swit|ch (wind|
|00000b20| 6f 77 43 6f 64 65 29 20 | 7b 0d 09 09 63 61 73 65 |owCode) |{...case|
|00000b30| 20 69 6e 53 79 73 57 69 | 6e 64 6f 77 3a 20 09 2f | inSysWi|ndow: ./|
|00000b40| 2f 20 44 65 73 6b 20 41 | 63 63 65 73 73 6f 72 79 |/ Desk A|ccessory|
|00000b50| 3f 0d 09 09 20 20 20 20 | 53 79 73 74 65 6d 43 6c |?... |SystemCl|
|00000b60| 69 63 6b 20 28 74 68 65 | 45 76 65 6e 74 2c 20 74 |ick (the|Event, t|
|00000b70| 68 65 57 69 6e 64 6f 77 | 29 3b 0d 09 09 20 20 20 |heWindow|);... |
|00000b80| 20 62 72 65 61 6b 3b 0d | 09 09 20 20 20 20 0d 09 | break;.|.. ..|
|00000b90| 09 63 61 73 65 20 69 6e | 4d 65 6e 75 42 61 72 3a |.case in|MenuBar:|
|00000ba0| 09 09 2f 2f 20 4d 65 6e | 75 20 42 61 72 3f 0d 09 |..// Men|u Bar?..|
|00000bb0| 09 20 20 09 4d 79 41 64 | 6a 75 73 74 4d 65 6e 75 |. .MyAd|justMenu|
|00000bc0| 73 28 29 3b 0d 09 09 20 | 20 20 20 4d 79 48 61 6e |s();... | MyHan|
|00000bd0| 64 6c 65 4d 65 6e 75 28 | 4d 65 6e 75 53 65 6c 65 |dleMenu(|MenuSele|
|00000be0| 63 74 28 74 68 65 45 76 | 65 6e 74 2d 3e 77 68 65 |ct(theEv|ent->whe|
|00000bf0| 72 65 29 29 3b 0d 09 09 | 20 20 20 20 62 72 65 61 |re));...| brea|
|00000c00| 6b 3b 0d 0d 09 09 64 65 | 66 61 75 6c 74 3a 09 09 |k;....de|fault:..|
|00000c10| 09 2f 2f 20 43 75 72 73 | 6f 72 20 77 61 73 20 69 |.// Curs|or was i|
|00000c20| 6e 73 69 64 65 20 6f 75 | 72 20 77 69 6e 64 6f 77 |nside ou|r window|
|00000c30| 0d 09 09 09 2f 2f 20 49 | 66 20 74 68 65 20 77 69 |....// I|f the wi|
|00000c40| 6e 64 6f 77 20 69 73 6e | 27 74 20 69 6e 20 74 68 |ndow isn|'t in th|
|00000c50| 65 20 66 72 6f 6e 74 0d | 09 09 09 69 66 20 28 74 |e front.|...if (t|
|00000c60| 68 65 57 69 6e 64 6f 77 | 20 21 3d 20 46 72 6f 6e |heWindow| != Fron|
|00000c70| 74 57 69 6e 64 6f 77 28 | 29 29 20 7b 0d 09 09 09 |tWindow(|)) {....|
|00000c80| 09 2f 2f 20 4d 61 6b 65 | 20 69 74 20 73 6f 2e 2e |.// Make| it so..|
|00000c90| 2e 0d 09 09 09 09 53 65 | 6c 65 63 74 57 69 6e 64 |......Se|lectWind|
|00000ca0| 6f 77 28 74 68 65 57 69 | 6e 64 6f 77 29 3b 0d 09 |ow(theWi|ndow);..|
|00000cb0| 09 09 09 4d 79 41 64 6a | 75 73 74 4d 65 6e 75 73 |...MyAdj|ustMenus|
|00000cc0| 28 29 3b 0d 09 09 09 7d | 0d 09 09 09 65 6c 73 65 |();....}|....else|
|00000cd0| 20 7b 0d 09 09 09 09 2f | 2f 20 57 69 6e 64 6f 77 | {...../|/ Window|
|00000ce0| 20 69 73 20 61 6c 72 65 | 61 64 79 20 69 6e 20 74 | is alre|ady in t|
|00000cf0| 68 65 20 66 72 6f 6e 74 | 2c 20 68 61 6e 64 6c 65 |he front|, handle|
|00000d00| 20 74 68 65 20 63 6c 69 | 63 6b 0d 09 09 09 09 73 | the cli|ck.....s|
|00000d10| 77 69 74 63 68 20 28 77 | 69 6e 64 6f 77 43 6f 64 |witch (w|indowCod|
|00000d20| 65 29 20 7b 0d 0d 09 09 | 09 09 63 61 73 65 20 69 |e) {....|..case i|
|00000d30| 6e 43 6f 6e 74 65 6e 74 | 3a 09 09 2f 2f 20 43 6f |nContent|:..// Co|
|00000d40| 6e 74 65 6e 74 20 61 72 | 65 61 3f 0d 09 09 09 09 |ntent ar|ea?.....|
|00000d50| 09 69 66 20 28 28 28 57 | 69 6e 64 6f 77 50 65 65 |.if (((W|indowPee|
|00000d60| 6b 29 20 74 68 65 57 69 | 6e 64 6f 77 29 2d 3e 72 |k) theWi|ndow)->r|
|00000d70| 65 66 43 6f 6e 20 3d 3d | 20 4d 79 57 69 6e 64 6f |efCon ==| MyWindo|
|00000d80| 77 49 44 29 0d 09 09 09 | 09 09 09 28 28 4f 62 6a |wID)....|...((Obj|
|00000d90| 65 63 74 57 69 6e 64 6f | 77 50 74 72 29 20 74 68 |ectWindo|wPtr) th|
|00000da0| 65 57 69 6e 64 6f 77 29 | 2d 3e 48 61 6e 64 6c 65 |eWindow)|->Handle|
|00000db0| 43 6c 69 63 6b 28 74 68 | 65 57 69 6e 64 6f 77 2c |Click(th|eWindow,|
|00000dc0| 20 74 68 65 45 76 65 6e | 74 2d 3e 77 68 65 72 65 | theEven|t->where|
|00000dd0| 2c 20 74 68 65 45 76 65 | 6e 74 29 3b 0d 09 09 09 |, theEve|nt);....|
|00000de0| 09 09 62 72 65 61 6b 3b | 0d 0d 09 09 09 09 63 61 |..break;|......ca|
|00000df0| 73 65 20 69 6e 44 72 61 | 67 3a 09 09 2f 2f 20 44 |se inDra|g:..// D|
|00000e00| 72 61 67 62 61 72 3f 0d | 09 09 09 09 09 7b 0d 09 |ragbar?.|.....{..|
|00000e10| 09 09 09 09 09 52 65 63 | 74 09 64 72 61 67 52 65 |.....Rec|t.dragRe|
|00000e20| 63 74 3b 0d 09 09 09 09 | 09 09 64 72 61 67 52 65 |ct;.....|..dragRe|
|00000e30| 63 74 20 3d 20 73 63 72 | 65 65 6e 42 69 74 73 2e |ct = scr|eenBits.|
|00000e40| 62 6f 75 6e 64 73 3b 0d | 09 09 09 09 09 09 2f 2f |bounds;.|......//|
|00000e50| 20 48 61 6e 64 6c 65 20 | 74 68 65 20 64 72 61 67 | Handle |the drag|
|00000e60| 67 69 6e 67 20 6f 66 20 | 74 68 65 20 77 69 6e 64 |ging of |the wind|
|00000e70| 6f 77 0d 09 09 09 09 09 | 09 44 72 61 67 57 69 6e |ow......|.DragWin|
|00000e80| 64 6f 77 28 74 68 65 57 | 69 6e 64 6f 77 2c 20 74 |dow(theW|indow, t|
|00000e90| 68 65 45 76 65 6e 74 2d | 3e 77 68 65 72 65 2c 20 |heEvent-|>where, |
|00000ea0| 26 64 72 61 67 52 65 63 | 74 29 3b 0d 09 09 09 09 |&dragRec|t);.....|
|00000eb0| 09 09 69 66 20 28 21 28 | 28 4f 62 6a 65 63 74 57 |..if (!(|(ObjectW|
|00000ec0| 69 6e 64 6f 77 50 74 72 | 29 20 74 68 65 57 69 6e |indowPtr|) theWin|
|00000ed0| 64 6f 77 29 2d 3e 66 6c | 6f 61 74 69 6e 67 29 0d |dow)->fl|oating).|
|00000ee0| 09 09 09 09 09 09 09 53 | 65 6c 65 63 74 57 69 6e |.......S|electWin|
|00000ef0| 64 6f 77 28 74 68 65 57 | 69 6e 64 6f 77 29 3b 0d |dow(theW|indow);.|
|00000f00| 09 09 09 09 09 7d 0d 09 | 09 09 09 09 62 72 65 61 |.....}..|....brea|
|00000f10| 6b 3b 0d 0d 09 09 09 09 | 20 63 61 73 65 20 69 6e |k;......| case in|
|00000f20| 47 6f 41 77 61 79 3a 09 | 09 09 09 09 09 2f 2f 20 |GoAway:.|.....// |
|00000f30| 63 6c 6f 73 65 20 62 6f | 78 3f 0d 09 09 09 20 20 |close bo|x?.... |
|00000f40| 09 09 69 66 20 28 54 72 | 61 63 6b 47 6f 41 77 61 |..if (Tr|ackGoAwa|
|00000f50| 79 28 74 68 65 57 69 6e | 64 6f 77 2c 20 74 68 65 |y(theWin|dow, the|
|00000f60| 45 76 65 6e 74 2d 3e 77 | 68 65 72 65 29 29 20 7b |Event->w|here)) {|
|00000f70| 0d 09 09 09 09 09 09 2f | 2f 20 49 66 20 6d 6f 75 |......./|/ If mou|
|00000f80| 73 65 20 69 73 20 72 65 | 6c 65 61 73 65 64 20 69 |se is re|leased i|
|00000f90| 6e 73 69 64 65 20 74 68 | 65 20 63 6c 6f 73 65 20 |nside th|e close |
|00000fa0| 62 6f 78 0d 09 09 09 09 | 09 09 2f 2f 20 48 69 64 |box.....|..// Hid|
|00000fb0| 65 20 6f 72 20 63 6c 6f | 73 65 20 74 68 65 20 77 |e or clo|se the w|
|00000fc0| 69 6e 64 6f 77 0d 09 09 | 09 09 09 20 20 09 69 66 |indow...|... .if|
|00000fd0| 20 28 28 28 57 69 6e 64 | 6f 77 50 65 65 6b 29 20 | (((Wind|owPeek) |
|00000fe0| 74 68 65 57 69 6e 64 6f | 77 29 2d 3e 72 65 66 43 |theWindo|w)->refC|
|00000ff0| 6f 6e 20 3d 3d 20 4d 79 | 57 69 6e 64 6f 77 49 44 |on == My|WindowID|
|00001000| 29 0d 09 09 09 09 09 09 | 09 43 6c 6f 73 65 45 64 |).......|.CloseEd|
|00001010| 69 74 57 69 6e 64 6f 77 | 28 74 68 65 57 69 6e 64 |itWindow|(theWind|
|00001020| 6f 77 29 3b 0d 09 09 09 | 09 09 09 65 6c 73 65 20 |ow);....|...else |
|00001030| 69 66 20 28 74 68 65 57 | 69 6e 64 6f 77 20 3d 3d |if (theW|indow ==|
|00001040| 20 67 53 65 61 72 63 68 | 57 69 6e 29 20 7b 0d 09 | gSearch|Win) {..|
|00001050| 09 09 09 09 09 09 44 69 | 73 70 6f 73 44 69 61 6c |......Di|sposDial|
|00001060| 6f 67 28 67 53 65 61 72 | 63 68 57 69 6e 29 3b 0d |og(gSear|chWin);.|
|00001070| 09 09 09 09 09 09 09 67 | 53 65 61 72 63 68 57 69 |.......g|SearchWi|
|00001080| 6e 20 3d 20 4e 55 4c 4c | 3b 0d 09 09 09 09 09 09 |n = NULL|;.......|
|00001090| 7d 0d 09 09 09 09 09 09 | 4d 79 41 64 6a 75 73 74 |}.......|MyAdjust|
|000010a0| 4d 65 6e 75 73 28 29 3b | 0d 09 09 09 09 09 7d 0d |Menus();|......}.|
|000010b0| 09 09 09 09 20 20 09 62 | 72 65 61 6b 3b 0d 0d 09 |.... .b|reak;...|
|000010c0| 09 09 09 63 61 73 65 20 | 69 6e 47 72 6f 77 3a 09 |...case |inGrow:.|
|000010d0| 09 09 09 09 09 2f 2f 20 | 47 72 6f 77 20 62 6f 78 |.....// |Grow box|
|000010e0| 3f 0d 09 09 09 09 09 7b | 0d 09 09 09 09 09 09 6c |?......{|.......l|
|000010f0| 6f 6e 67 09 67 72 6f 77 | 52 65 73 75 6c 74 3b 0d |ong.grow|Result;.|
|00001100| 09 09 09 09 09 09 52 65 | 63 74 09 67 72 6f 77 52 |......Re|ct.growR|
|00001110| 65 63 74 3b 0d 0d 09 09 | 09 09 09 09 53 65 6c 65 |ect;....|....Sele|
|00001120| 63 74 57 69 6e 64 6f 77 | 28 74 68 65 57 69 6e 64 |ctWindow|(theWind|
|00001130| 6f 77 29 3b 0d 0d 09 09 | 09 09 09 09 53 65 74 52 |ow);....|....SetR|
|00001140| 65 63 74 28 26 67 72 6f | 77 52 65 63 74 2c 4d 61 |ect(&gro|wRect,Ma|
|00001150| 78 57 69 6e 64 6f 77 57 | 69 64 74 68 2b 53 42 61 |xWindowW|idth+SBa|
|00001160| 72 53 69 7a 65 2d 31 2c | 36 34 2c 0d 09 09 09 09 |rSize-1,|64,.....|
|00001170| 09 09 09 09 4d 61 78 57 | 69 6e 64 6f 77 57 69 64 |....MaxW|indowWid|
|00001180| 74 68 2b 53 42 61 72 53 | 69 7a 65 2d 31 2c 67 4d |th+SBarS|ize-1,gM|
|00001190| 61 78 48 65 69 67 68 74 | 29 3b 0d 0d 09 09 09 09 |axHeight|);......|
|000011a0| 09 09 2f 2f 20 48 61 6e | 64 6c 65 20 74 68 65 20 |..// Han|dle the |
|000011b0| 6d 6f 75 73 65 20 74 72 | 61 63 6b 69 6e 67 20 66 |mouse tr|acking f|
|000011c0| 6f 72 20 74 68 65 20 72 | 65 73 69 7a 69 6e 67 0d |or the r|esizing.|
|000011d0| 09 09 09 09 09 09 67 72 | 6f 77 52 65 73 75 6c 74 |......gr|owResult|
|000011e0| 20 3d 20 47 72 6f 77 57 | 69 6e 64 6f 77 28 74 68 | = GrowW|indow(th|
|000011f0| 65 57 69 6e 64 6f 77 2c | 74 68 65 45 76 65 6e 74 |eWindow,|theEvent|
|00001200| 2d 3e 77 68 65 72 65 2c | 26 67 72 6f 77 52 65 63 |->where,|&growRec|
|00001210| 74 29 3b 0d 0d 09 09 09 | 09 09 09 2f 2f 20 43 68 |t);.....|...// Ch|
|00001220| 61 6e 67 65 20 74 68 65 | 20 73 69 7a 65 20 6f 66 |ange the| size of|
|00001230| 20 74 68 65 20 77 69 6e | 64 6f 77 0d 09 09 09 09 | the win|dow.....|
|00001240| 09 09 53 69 7a 65 57 69 | 6e 64 6f 77 28 74 68 65 |..SizeWi|ndow(the|
|00001250| 57 69 6e 64 6f 77 2c 4c | 6f 57 6f 72 64 28 67 72 |Window,L|oWord(gr|
|00001260| 6f 77 52 65 73 75 6c 74 | 29 2c 48 69 57 6f 72 64 |owResult|),HiWord|
|00001270| 28 67 72 6f 77 52 65 73 | 75 6c 74 29 2c 74 72 75 |(growRes|ult),tru|
|00001280| 65 29 3b 0d 0d 09 09 09 | 09 09 09 41 64 6a 75 73 |e);.....|...Adjus|
|00001290| 74 53 63 72 6f 6c 6c 42 | 61 72 73 28 74 68 65 57 |tScrollB|ars(theW|
|000012a0| 69 6e 64 6f 77 2c 20 74 | 72 75 65 29 3b 0d 09 09 |indow, t|rue);...|
|000012b0| 09 09 09 09 44 72 61 77 | 50 61 67 65 28 28 45 64 |....Draw|Page((Ed|
|000012c0| 69 74 57 69 6e 64 6f 77 | 50 74 72 29 20 74 68 65 |itWindow|Ptr) the|
|000012d0| 57 69 6e 64 6f 77 29 3b | 0d 0d 09 09 09 09 09 09 |Window);|........|
|000012e0| 2f 2f 20 52 65 64 72 61 | 77 20 74 68 65 20 77 69 |// Redra|w the wi|
|000012f0| 6e 64 6f 77 0d 09 09 09 | 09 09 09 53 65 74 50 6f |ndow....|...SetPo|
|00001300| 72 74 28 74 68 65 57 69 | 6e 64 6f 77 29 3b 0d 09 |rt(theWi|ndow);..|
|00001310| 09 09 09 09 20 20 09 49 | 6e 76 61 6c 52 65 63 74 |.... .I|nvalRect|
|00001320| 28 26 74 68 65 57 69 6e | 64 6f 77 2d 3e 70 6f 72 |(&theWin|dow->por|
|00001330| 74 52 65 63 74 29 3b 0d | 09 09 09 09 09 7d 0d 09 |tRect);.|.....}..|
|00001340| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 09 63 |....brea|k;.....c|
|00001350| 61 73 65 20 69 6e 5a 6f | 6f 6d 49 6e 3a 0d 09 09 |ase inZo|omIn:...|
|00001360| 09 09 63 61 73 65 20 69 | 6e 5a 6f 6f 6d 4f 75 74 |..case i|nZoomOut|
|00001370| 3a 0d 09 09 09 09 09 69 | 66 20 28 54 72 61 63 6b |:......i|f (Track|
|00001380| 42 6f 78 28 74 68 65 57 | 69 6e 64 6f 77 2c 20 74 |Box(theW|indow, t|
|00001390| 68 65 45 76 65 6e 74 2d | 3e 77 68 65 72 65 2c 20 |heEvent-|>where, |
|000013a0| 77 69 6e 64 6f 77 43 6f | 64 65 29 29 20 7b 0d 09 |windowCo|de)) {..|
|000013b0| 09 09 09 09 09 53 65 74 | 50 6f 72 74 28 74 68 65 |.....Set|Port(the|
|000013c0| 57 69 6e 64 6f 77 29 3b | 0d 09 09 09 09 09 09 45 |Window);|.......E|
|000013d0| 72 61 73 65 52 65 63 74 | 28 26 74 68 65 57 69 6e |raseRect|(&theWin|
|000013e0| 64 6f 77 2d 3e 70 6f 72 | 74 52 65 63 74 29 3b 0d |dow->por|tRect);.|
|000013f0| 09 09 09 09 09 09 5a 6f | 6f 6d 57 69 6e 64 6f 77 |......Zo|omWindow|
|00001400| 28 74 68 65 57 69 6e 64 | 6f 77 2c 20 77 69 6e 64 |(theWind|ow, wind|
|00001410| 6f 77 43 6f 64 65 2c 20 | 74 72 75 65 29 3b 0d 09 |owCode, |true);..|
|00001420| 09 09 09 09 09 41 64 6a | 75 73 74 53 63 72 6f 6c |.....Adj|ustScrol|
|00001430| 6c 42 61 72 73 28 74 68 | 65 57 69 6e 64 6f 77 2c |lBars(th|eWindow,|
|00001440| 20 74 72 75 65 29 3b 0d | 09 09 09 09 09 09 44 72 | true);.|......Dr|
|00001450| 61 77 50 61 67 65 28 28 | 45 64 69 74 57 69 6e 64 |awPage((|EditWind|
|00001460| 6f 77 50 74 72 29 20 74 | 68 65 57 69 6e 64 6f 77 |owPtr) t|heWindow|
|00001470| 29 3b 0d 09 09 09 09 09 | 09 2f 2f 20 52 65 64 72 |);......|.// Redr|
|00001480| 61 77 20 74 68 65 20 77 | 69 6e 64 6f 77 0d 09 09 |aw the w|indow...|
|00001490| 09 09 09 09 53 65 74 50 | 6f 72 74 28 74 68 65 57 |....SetP|ort(theW|
|000014a0| 69 6e 64 6f 77 29 3b 0d | 09 09 09 09 09 20 20 09 |indow);.|..... .|
|000014b0| 49 6e 76 61 6c 52 65 63 | 74 28 26 74 68 65 57 69 |InvalRec|t(&theWi|
|000014c0| 6e 64 6f 77 2d 3e 70 6f | 72 74 52 65 63 74 29 3b |ndow->po|rtRect);|
|000014d0| 0d 09 09 09 09 09 7d 0d | 09 09 09 09 7d 0d 09 09 |......}.|....}...|
|000014e0| 09 7d 0d 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 7d |.}....br|eak;...}|
|000014f0| 0d 09 09 62 72 65 61 6b | 3b 0d 09 09 0d 09 2f 2f |...break|;.....//|
|00001500| 20 57 61 73 20 61 20 6b | 65 79 20 70 72 65 73 73 | Was a k|ey press|
|00001510| 65 64 3f 0d 09 63 61 73 | 65 20 6b 65 79 44 6f 77 |ed?..cas|e keyDow|
|00001520| 6e 3a 20 0d 09 63 61 73 | 65 20 61 75 74 6f 4b 65 |n: ..cas|e autoKe|
|00001530| 79 3a 0d 09 09 2f 2f 20 | 57 61 73 20 74 68 65 20 |y:...// |Was the |
|00001540| 63 6d 64 2d 6b 65 79 20 | 62 65 69 6e 67 20 68 65 |cmd-key |being he|
|00001550| 6c 64 20 64 6f 77 6e 3f | 20 20 49 66 20 73 6f 2c |ld down?| If so,|
|00001560| 20 70 72 6f 63 65 73 73 | 20 6d 65 6e 75 20 62 61 | process| menu ba|
|00001570| 72 20 73 68 6f 72 74 20 | 63 75 74 73 2e 0d 09 20 |r short |cuts... |
|00001580| 20 20 20 69 66 20 28 28 | 74 68 65 45 76 65 6e 74 | if ((|theEvent|
|00001590| 2d 3e 6d 6f 64 69 66 69 | 65 72 73 20 26 20 63 6d |->modifi|ers & cm|
|000015a0| 64 4b 65 79 29 20 21 3d | 20 30 29 20 7b 0d 09 20 |dKey) !=| 0) {.. |
|000015b0| 20 20 20 20 20 4d 79 41 | 64 6a 75 73 74 4d 65 6e | MyA|djustMen|
|000015c0| 75 73 28 29 3b 0d 09 09 | 20 20 4d 79 48 61 6e 64 |us();...| MyHand|
|000015d0| 6c 65 4d 65 6e 75 28 4d | 65 6e 75 4b 65 79 28 28 |leMenu(M|enuKey((|
|000015e0| 63 68 61 72 29 20 28 74 | 68 65 45 76 65 6e 74 2d |char) (t|heEvent-|
|000015f0| 3e 6d 65 73 73 61 67 65 | 20 26 20 63 68 61 72 43 |>message| & charC|
|00001600| 6f 64 65 4d 61 73 6b 29 | 29 29 3b 0d 09 09 7d 0d |odeMask)|));...}.|
|00001610| 09 09 65 6c 73 65 20 7b | 0d 09 09 09 74 68 65 57 |..else {|....theW|
|00001620| 69 6e 64 6f 77 20 3d 20 | 46 72 6f 6e 74 57 69 6e |indow = |FrontWin|
|00001630| 64 6f 77 28 29 3b 0d 09 | 09 09 69 66 20 28 28 28 |dow();..|..if (((|
|00001640| 57 69 6e 64 6f 77 50 65 | 65 6b 29 20 74 68 65 57 |WindowPe|ek) theW|
|00001650| 69 6e 64 6f 77 29 2d 3e | 72 65 66 43 6f 6e 20 3d |indow)->|refCon =|
|00001660| 3d 20 4d 79 57 69 6e 64 | 6f 77 49 44 20 26 26 0d |= MyWind|owID &&.|
|00001670| 09 09 09 09 28 28 4f 62 | 6a 65 63 74 57 69 6e 64 |....((Ob|jectWind|
|00001680| 6f 77 50 74 72 29 20 74 | 68 65 57 69 6e 64 6f 77 |owPtr) t|heWindow|
|00001690| 29 2d 3e 50 72 6f 63 65 | 73 73 4b 65 79 20 21 3d |)->Proce|ssKey !=|
|000016a0| 20 4e 55 4c 4c 29 0d 09 | 09 09 09 28 28 4f 62 6a | NULL)..|...((Obj|
|000016b0| 65 63 74 57 69 6e 64 6f | 77 50 74 72 29 20 74 68 |ectWindo|wPtr) th|
|000016c0| 65 57 69 6e 64 6f 77 29 | 2d 3e 50 72 6f 63 65 73 |eWindow)|->Proces|
|000016d0| 73 4b 65 79 28 74 68 65 | 57 69 6e 64 6f 77 2c 20 |sKey(the|Window, |
|000016e0| 74 68 65 45 76 65 6e 74 | 29 3b 0d 09 09 7d 0d 09 |theEvent|);...}..|
|000016f0| 09 62 72 65 61 6b 3b 0d | 0d 09 2f 2f 20 44 6f 65 |.break;.|..// Doe|
|00001700| 73 20 61 20 77 69 6e 64 | 6f 77 20 6e 65 65 64 20 |s a wind|ow need |
|00001710| 74 6f 20 62 65 20 72 65 | 64 72 61 77 6e 3f 0d 09 |to be re|drawn?..|
|00001720| 63 61 73 65 20 75 70 64 | 61 74 65 45 76 74 3a 0d |case upd|ateEvt:.|
|00001730| 09 09 74 68 65 57 69 6e | 64 6f 77 20 3d 20 28 57 |..theWin|dow = (W|
|00001740| 69 6e 64 6f 77 50 74 72 | 29 20 74 68 65 45 76 65 |indowPtr|) theEve|
|00001750| 6e 74 2d 3e 6d 65 73 73 | 61 67 65 3b 0d 09 09 69 |nt->mess|age;...i|
|00001760| 66 20 28 28 28 57 69 6e | 64 6f 77 50 65 65 6b 29 |f (((Win|dowPeek)|
|00001770| 20 74 68 65 57 69 6e 64 | 6f 77 29 2d 3e 72 65 66 | theWind|ow)->ref|
|00001780| 43 6f 6e 20 3d 3d 20 4d | 79 57 69 6e 64 6f 77 49 |Con == M|yWindowI|
|00001790| 44 29 0d 09 09 09 28 28 | 4f 62 6a 65 63 74 57 69 |D)....((|ObjectWi|
|000017a0| 6e 64 6f 77 50 74 72 29 | 20 74 68 65 57 69 6e 64 |ndowPtr)| theWind|
|000017b0| 6f 77 29 2d 3e 55 70 64 | 61 74 65 28 74 68 65 57 |ow)->Upd|ate(theW|
|000017c0| 69 6e 64 6f 77 29 3b 0d | 09 20 20 20 20 62 72 65 |indow);.|. bre|
|000017d0| 61 6b 3b 0d 0d 09 2f 2f | 20 48 61 73 20 61 20 77 |ak;...//| Has a w|
|000017e0| 69 6e 64 6f 77 20 62 65 | 65 6e 20 61 63 74 69 76 |indow be|en activ|
|000017f0| 61 74 65 64 20 6f 72 20 | 64 65 61 63 74 69 76 61 |ated or |deactiva|
|00001800| 74 65 64 3f 0d 09 63 61 | 73 65 20 61 63 74 69 76 |ted?..ca|se activ|
|00001810| 61 74 65 45 76 74 3a 0d | 09 09 74 68 65 57 69 6e |ateEvt:.|..theWin|
|00001820| 64 6f 77 20 3d 20 28 57 | 69 6e 64 6f 77 50 74 72 |dow = (W|indowPtr|
|00001830| 29 20 74 68 65 45 76 65 | 6e 74 2d 3e 6d 65 73 73 |) theEve|nt->mess|
|00001840| 61 67 65 3b 0d 0d 09 09 | 2f 2f 20 46 6f 72 63 65 |age;....|// Force|
|00001850| 20 69 74 20 74 6f 20 62 | 65 20 72 65 64 72 61 77 | it to b|e redraw|
|00001860| 6e 0d 09 09 69 66 20 28 | 28 28 57 69 6e 64 6f 77 |n...if (|((Window|
|00001870| 50 65 65 6b 29 20 74 68 | 65 57 69 6e 64 6f 77 29 |Peek) th|eWindow)|
|00001880| 2d 3e 72 65 66 43 6f 6e | 20 3d 3d 20 4d 79 57 69 |->refCon| == MyWi|
|00001890| 6e 64 6f 77 49 44 29 0d | 09 09 09 28 28 4f 62 6a |ndowID).|...((Obj|
|000018a0| 65 63 74 57 69 6e 64 6f | 77 50 74 72 29 20 74 68 |ectWindo|wPtr) th|
|000018b0| 65 57 69 6e 64 6f 77 29 | 2d 3e 41 63 74 69 76 61 |eWindow)|->Activa|
|000018c0| 74 65 28 74 68 65 57 69 | 6e 64 6f 77 2c 28 74 68 |te(theWi|ndow,(th|
|000018d0| 65 45 76 65 6e 74 2d 3e | 6d 6f 64 69 66 69 65 72 |eEvent->|modifier|
|000018e0| 73 20 26 20 61 63 74 69 | 76 65 46 6c 61 67 29 20 |s & acti|veFlag) |
|000018f0| 3e 20 30 29 3b 0d 0d 09 | 09 62 72 65 61 6b 3b 0d |> 0);...|.break;.|
|00001900| 09 63 61 73 65 20 6f 73 | 45 76 74 3a 0d 09 09 2f |.case os|Evt:.../|
|00001910| 2f 20 46 6f 72 63 65 20 | 69 74 20 74 6f 20 62 65 |/ Force |it to be|
|00001920| 20 72 65 64 72 61 77 6e | 0d 09 09 73 77 69 74 63 | redrawn|...switc|
|00001930| 68 20 28 74 68 65 45 76 | 65 6e 74 2d 3e 6d 65 73 |h (theEv|ent->mes|
|00001940| 73 61 67 65 20 3e 3e 20 | 32 34 29 20 7b 0d 09 09 |sage >> |24) {...|
|00001950| 63 61 73 65 20 73 75 73 | 70 65 6e 64 52 65 73 75 |case sus|pendResu|
|00001960| 6d 65 4d 65 73 73 61 67 | 65 3a 0d 09 09 09 74 68 |meMessag|e:....th|
|00001970| 65 57 69 6e 64 6f 77 20 | 3d 20 46 72 6f 6e 74 57 |eWindow |= FrontW|
|00001980| 69 6e 64 6f 77 28 29 3b | 0d 09 09 09 69 66 20 28 |indow();|....if (|
|00001990| 74 68 65 57 69 6e 64 6f | 77 20 26 26 20 28 28 57 |theWindo|w && ((W|
|000019a0| 69 6e 64 6f 77 50 65 65 | 6b 29 20 74 68 65 57 69 |indowPee|k) theWi|
|000019b0| 6e 64 6f 77 29 2d 3e 72 | 65 66 43 6f 6e 20 3d 3d |ndow)->r|efCon ==|
|000019c0| 20 4d 79 57 69 6e 64 6f | 77 49 44 29 0d 09 09 09 | MyWindo|wID)....|
|000019d0| 09 28 28 4f 62 6a 65 63 | 74 57 69 6e 64 6f 77 50 |.((Objec|tWindowP|
|000019e0| 74 72 29 20 74 68 65 57 | 69 6e 64 6f 77 29 2d 3e |tr) theW|indow)->|
|000019f0| 41 63 74 69 76 61 74 65 | 28 74 68 65 57 69 6e 64 |Activate|(theWind|
|00001a00| 6f 77 2c 28 74 68 65 45 | 76 65 6e 74 2d 3e 6d 65 |ow,(theE|vent->me|
|00001a10| 73 73 61 67 65 20 26 20 | 72 65 73 75 6d 65 46 6c |ssage & |resumeFl|
|00001a20| 61 67 29 20 3e 20 30 29 | 3b 0d 09 09 09 62 72 65 |ag) > 0)|;....bre|
|00001a30| 61 6b 3b 0d 09 09 7d 0d | 09 09 62 72 65 61 6b 3b |ak;...}.|..break;|
|00001a40| 09 09 0d 09 63 61 73 65 | 20 6b 48 69 67 68 4c 65 |....case| kHighLe|
|00001a50| 76 65 6c 45 76 65 6e 74 | 3a 0d 09 09 69 66 20 28 |velEvent|:...if (|
|00001a60| 67 53 79 73 37 46 6c 61 | 67 29 0d 09 09 09 41 45 |gSys7Fla|g)....AE|
|00001a70| 50 72 6f 63 65 73 73 41 | 70 70 6c 65 45 76 65 6e |ProcessA|ppleEven|
|00001a80| 74 28 74 68 65 45 76 65 | 6e 74 29 3b 0d 09 09 62 |t(theEve|nt);...b|
|00001a90| 72 65 61 6b 3b 0d 20 20 | 20 20 7d 0d 7d 09 20 20 |reak;. | }.}. |
|00001aa0| 20 20 0d 0d 2f 2f 20 44 | 6f 20 49 64 6c 65 20 54 | ..// D|o Idle T|
|00001ab0| 69 6d 65 20 50 72 6f 63 | 65 73 73 69 6e 67 0d 0d |ime Proc|essing..|
|00001ac0| 76 6f 69 64 20 49 64 6c | 65 4f 62 6a 65 63 74 73 |void Idl|eObjects|
|00001ad0| 28 45 76 65 6e 74 52 65 | 63 6f 72 64 20 2a 65 72 |(EventRe|cord *er|
|00001ae0| 29 0d 7b 0d 09 57 69 6e | 64 6f 77 50 65 65 6b 09 |).{..Win|dowPeek.|
|00001af0| 74 68 65 57 69 6e 3b 0d | 09 74 68 65 57 69 6e 20 |theWin;.|.theWin |
|00001b00| 3d 20 28 57 69 6e 64 6f | 77 50 65 65 6b 29 20 46 |= (Windo|wPeek) F|
|00001b10| 72 6f 6e 74 57 69 6e 64 | 6f 77 28 29 3b 0d 09 77 |rontWind|ow();..w|
|00001b20| 68 69 6c 65 20 28 74 68 | 65 57 69 6e 29 20 7b 0d |hile (th|eWin) {.|
|00001b30| 09 09 69 66 20 28 74 68 | 65 57 69 6e 2d 3e 72 65 |..if (th|eWin->re|
|00001b40| 66 43 6f 6e 20 3d 3d 20 | 4d 79 57 69 6e 64 6f 77 |fCon == |MyWindow|
|00001b50| 49 44 20 26 26 0d 09 09 | 09 28 28 4f 62 6a 65 63 |ID &&...|.((Objec|
|00001b60| 74 57 69 6e 64 6f 77 50 | 74 72 29 20 74 68 65 57 |tWindowP|tr) theW|
|00001b70| 69 6e 29 2d 3e 49 64 6c | 65 29 0d 09 09 09 28 28 |in)->Idl|e)....((|
|00001b80| 4f 62 6a 65 63 74 57 69 | 6e 64 6f 77 50 74 72 29 |ObjectWi|ndowPtr)|
|00001b90| 20 74 68 65 57 69 6e 29 | 2d 3e 49 64 6c 65 28 28 | theWin)|->Idle((|
|00001ba0| 57 69 6e 64 6f 77 50 74 | 72 29 20 74 68 65 57 69 |WindowPt|r) theWi|
|00001bb0| 6e 2c 20 65 72 29 3b 0d | 09 09 74 68 65 57 69 6e |n, er);.|..theWin|
|00001bc0| 20 3d 20 74 68 65 57 69 | 6e 2d 3e 6e 65 78 74 57 | = theWi|n->nextW|
|00001bd0| 69 6e 64 6f 77 3b 0d 09 | 7d 0d 7d 0d 0d 42 6f 6f |indow;..|}.}..Boo|
|00001be0| 6c 65 61 6e 20 47 6f 74 | 52 65 71 75 69 72 65 64 |lean Got|Required|
|00001bf0| 50 61 72 61 6d 73 28 41 | 70 70 6c 65 45 76 65 6e |Params(A|ppleEven|
|00001c00| 74 20 2a 74 68 65 45 76 | 65 6e 74 29 0d 7b 0d 20 |t *theEv|ent).{. |
|00001c10| 20 20 44 65 73 63 54 79 | 70 65 20 72 65 74 75 72 | DescTy|pe retur|
|00001c20| 6e 65 64 54 79 70 65 3b | 0d 20 20 20 53 69 7a 65 |nedType;|. Size|
|00001c30| 20 09 61 63 74 75 61 6c | 53 69 7a 65 3b 0d 20 20 | .actual|Size;. |
|00001c40| 20 4f 53 45 72 72 09 65 | 72 72 3b 0d 20 20 20 65 | OSErr.e|rr;. e|
|00001c50| 72 72 20 3d 20 41 45 47 | 65 74 41 74 74 72 69 62 |rr = AEG|etAttrib|
|00001c60| 75 74 65 50 74 72 20 28 | 20 74 68 65 45 76 65 6e |utePtr (| theEven|
|00001c70| 74 2c 20 6b 65 79 4d 69 | 73 73 65 64 4b 65 79 77 |t, keyMi|ssedKeyw|
|00001c80| 6f 72 64 41 74 74 72 2c | 20 0d 09 09 09 09 09 09 |ordAttr,| .......|
|00001c90| 74 79 70 65 57 69 6c 64 | 43 61 72 64 2c 20 26 72 |typeWild|Card, &r|
|00001ca0| 65 74 75 72 6e 65 64 54 | 79 70 65 2c 20 4e 55 4c |eturnedT|ype, NUL|
|00001cb0| 4c 2c 20 30 2c 20 0d 09 | 09 09 09 09 09 26 61 63 |L, 0, ..|.....&ac|
|00001cc0| 74 75 61 6c 53 69 7a 65 | 29 3b 0d 20 20 20 0d 20 |tualSize|);. . |
|00001cd0| 20 20 72 65 74 75 72 6e | 20 65 72 72 20 3d 3d 20 | return| err == |
|00001ce0| 65 72 72 41 45 44 65 73 | 63 4e 6f 74 46 6f 75 6e |errAEDes|cNotFoun|
|00001cf0| 64 3b 0d 20 20 20 0d 20 | 7d 09 2f 2a 20 43 41 70 |d;. . |}./* CAp|
|00001d00| 70 6c 65 45 76 65 6e 74 | 3a 3a 47 6f 74 52 65 71 |pleEvent|::GotReq|
|00001d10| 75 69 72 65 64 50 61 72 | 61 6d 73 20 2a 2f 0d 0d |uiredPar|ams */..|
|00001d20| 0d 76 6f 69 64 20 44 6f | 4f 70 65 6e 45 76 65 6e |.void Do|OpenEven|
|00001d30| 74 28 41 70 70 6c 65 45 | 76 65 6e 74 20 2a 74 68 |t(AppleE|vent *th|
|00001d40| 65 45 76 65 6e 74 29 0d | 7b 0d 09 48 61 6e 64 6c |eEvent).|{..Handl|
|00001d50| 65 09 09 64 6f 63 4c 69 | 73 74 20 3d 20 4e 55 4c |e..docLi|st = NUL|
|00001d60| 4c 3b 0d 09 6c 6f 6e 67 | 09 09 69 2c 20 6e 75 6d |L;..long|..i, num|
|00001d70| 44 6f 63 73 3b 0d 09 46 | 53 53 70 65 63 09 09 6d |Docs;..F|SSpec..m|
|00001d80| 79 46 53 53 3b 0d 09 44 | 65 73 63 54 79 70 65 09 |yFSS;..D|escType.|
|00001d90| 65 76 65 6e 74 49 44 3b | 0d 09 41 45 44 65 73 63 |eventID;|..AEDesc|
|00001da0| 4c 69 73 74 09 74 68 65 | 4c 69 73 74 3b 0d 09 41 |List.the|List;..A|
|00001db0| 45 4b 65 79 77 6f 72 64 | 09 61 65 4b 65 79 77 6f |EKeyword|.aeKeywo|
|00001dc0| 72 64 3d 6b 65 79 44 69 | 72 65 63 74 4f 62 6a 65 |rd=keyDi|rectObje|
|00001dd0| 63 74 3b 0d 09 6c 6f 6e | 67 09 09 69 74 65 6d 43 |ct;..lon|g..itemC|
|00001de0| 6f 75 6e 74 3b 0d 09 44 | 65 73 63 54 79 70 65 09 |ount;..D|escType.|
|00001df0| 61 63 74 75 61 6c 54 79 | 70 65 3b 0d 09 53 69 7a |actualTy|pe;..Siz|
|00001e00| 65 09 09 61 63 74 75 61 | 6c 53 69 7a 65 3b 0d 09 |e..actua|lSize;..|
|00001e10| 4f 53 45 72 72 09 09 6f | 65 3b 0d 0d 09 69 66 20 |OSErr..o|e;...if |
|00001e20| 28 28 6f 65 20 3d 20 41 | 45 47 65 74 50 61 72 61 |((oe = A|EGetPara|
|00001e30| 6d 44 65 73 63 28 20 74 | 68 65 45 76 65 6e 74 2c |mDesc( t|heEvent,|
|00001e40| 20 6b 65 79 44 69 72 65 | 63 74 4f 62 6a 65 63 74 | keyDire|ctObject|
|00001e50| 2c 20 74 79 70 65 41 45 | 4c 69 73 74 2c 20 26 74 |, typeAE|List, &t|
|00001e60| 68 65 4c 69 73 74 29 29 | 20 21 3d 20 6e 6f 45 72 |heList))| != noEr|
|00001e70| 72 29 20 7b 0d 09 09 44 | 65 62 75 67 53 74 72 28 |r) {...D|ebugStr(|
|00001e80| 22 5c 70 41 45 47 65 74 | 50 61 72 61 6d 44 65 73 |"\pAEGet|ParamDes|
|00001e90| 63 22 29 3b 0d 09 09 72 | 65 74 75 72 6e 3b 0d 09 |c");...r|eturn;..|
|00001ea0| 7d 0d 0d 0d 09 69 66 20 | 28 21 47 6f 74 52 65 71 |}....if |(!GotReq|
|00001eb0| 75 69 72 65 64 50 61 72 | 61 6d 73 28 74 68 65 45 |uiredPar|ams(theE|
|00001ec0| 76 65 6e 74 29 29 20 7b | 0d 09 09 44 65 62 75 67 |vent)) {|...Debug|
|00001ed0| 53 74 72 28 22 5c 70 47 | 6f 74 52 65 71 75 69 72 |Str("\pG|otRequir|
|00001ee0| 65 64 50 61 72 61 6d 73 | 22 29 3b 0d 09 09 72 65 |edParams|");...re|
|00001ef0| 74 75 72 6e 3b 0d 09 7d | 0d 0d 09 69 66 20 28 28 |turn;..}|...if ((|
|00001f00| 6f 65 20 3d 20 41 45 43 | 6f 75 6e 74 49 74 65 6d |oe = AEC|ountItem|
|00001f10| 73 28 20 26 74 68 65 4c | 69 73 74 2c 20 26 69 74 |s( &theL|ist, &it|
|00001f20| 65 6d 43 6f 75 6e 74 29 | 29 20 21 3d 20 6e 6f 45 |emCount)|) != noE|
|00001f30| 72 72 29 20 7b 0d 09 09 | 44 65 62 75 67 53 74 72 |rr) {...|DebugStr|
|00001f40| 28 22 5c 70 41 45 43 6f | 75 6e 74 49 74 65 6d 73 |("\pAECo|untItems|
|00001f50| 22 29 3b 0d 09 09 72 65 | 74 75 72 6e 3b 0d 09 7d |");...re|turn;..}|
|00001f60| 0d 0d 0d 09 66 6f 72 20 | 28 69 20 3d 20 31 3b 20 |....for |(i = 1; |
|00001f70| 69 20 3c 3d 20 69 74 65 | 6d 43 6f 75 6e 74 3b 20 |i <= ite|mCount; |
|00001f80| 69 2b 2b 29 0d 09 7b 0d | 09 09 6f 65 20 3d 20 41 |i++)..{.|..oe = A|
|00001f90| 45 47 65 74 4e 74 68 50 | 74 72 28 20 26 74 68 65 |EGetNthP|tr( &the|
|00001fa0| 4c 69 73 74 2c 20 69 2c | 20 74 79 70 65 46 53 53 |List, i,| typeFSS|
|00001fb0| 2c 20 26 61 65 4b 65 79 | 77 6f 72 64 2c 20 26 61 |, &aeKey|word, &a|
|00001fc0| 63 74 75 61 6c 54 79 70 | 65 2c 0d 09 09 09 09 09 |ctualTyp|e,......|
|00001fd0| 09 28 50 74 72 29 20 26 | 6d 79 46 53 53 2c 20 73 |.(Ptr) &|myFSS, s|
|00001fe0| 69 7a 65 6f 66 28 20 46 | 53 53 70 65 63 29 2c 20 |izeof( F|SSpec), |
|00001ff0| 26 61 63 74 75 61 6c 53 | 69 7a 65 29 3b 0d 0d 09 |&actualS|ize);...|
|00002000| 09 69 66 20 28 6f 65 20 | 3d 3d 20 6e 6f 45 72 72 |.if (oe |== noErr|
|00002010| 29 20 7b 0d 09 09 09 4f | 70 65 6e 45 64 69 74 57 |) {....O|penEditW|
|00002020| 69 6e 64 6f 77 28 26 6d | 79 46 53 53 29 3b 0d 09 |indow(&m|yFSS);..|
|00002030| 09 7d 0d 09 7d 0d 09 41 | 45 44 69 73 70 6f 73 65 |.}..}..A|EDispose|
|00002040| 44 65 73 63 28 26 74 68 | 65 4c 69 73 74 29 3b 0d |Desc(&th|eList);.|
|00002050| 09 2f 2f 20 65 76 65 6e | 74 20 77 61 73 20 68 61 |.// even|t was ha|
|00002060| 6e 64 6c 65 64 20 73 75 | 63 63 65 73 73 66 75 6c |ndled su|ccessful|
|00002070| 6c 79 0d 7d 0d 0d 70 61 | 73 63 61 6c 20 4f 53 45 |ly.}..pa|scal OSE|
|00002080| 72 72 20 41 70 70 6c 65 | 45 76 65 6e 74 48 61 6e |rr Apple|EventHan|
|00002090| 64 6c 65 72 28 41 70 70 | 6c 65 45 76 65 6e 74 20 |dler(App|leEvent |
|000020a0| 2a 74 68 65 45 76 65 6e | 74 2c 41 70 70 6c 65 45 |*theEven|t,AppleE|
|000020b0| 76 65 6e 74 20 2a 72 65 | 70 6c 79 2c 20 6c 6f 6e |vent *re|ply, lon|
|000020c0| 67 20 72 65 66 43 6f 6e | 29 0d 7b 09 0d 09 4f 53 |g refCon|).{...OS|
|000020d0| 45 72 72 09 09 65 72 72 | 3b 0d 09 44 65 73 63 54 |Err..err|;..DescT|
|000020e0| 79 70 65 09 61 63 74 75 | 61 6c 54 79 70 65 3b 0d |ype.actu|alType;.|
|000020f0| 09 53 69 7a 65 09 09 61 | 63 74 75 61 6c 53 69 7a |.Size..a|ctualSiz|
|00002100| 65 3b 0d 09 44 65 73 63 | 54 79 70 65 09 65 76 65 |e;..Desc|Type.eve|
|00002110| 6e 74 43 6c 61 73 73 2c | 20 65 76 65 6e 74 49 44 |ntClass,| eventID|
|00002120| 3b 0d 09 4f 53 45 72 72 | 09 09 6f 65 3b 0d 0d 09 |;..OSErr|..oe;...|
|00002130| 69 66 20 28 28 6f 65 20 | 3d 20 41 45 47 65 74 41 |if ((oe |= AEGetA|
|00002140| 74 74 72 69 62 75 74 65 | 50 74 72 28 20 28 41 70 |ttribute|Ptr( (Ap|
|00002150| 70 6c 65 45 76 65 6e 74 | 2a 29 20 74 68 65 45 76 |pleEvent|*) theEv|
|00002160| 65 6e 74 2c 20 6b 65 79 | 45 76 65 6e 74 43 6c 61 |ent, key|EventCla|
|00002170| 73 73 41 74 74 72 2c 0d | 09 09 09 09 09 74 79 70 |ssAttr,.|.....typ|
|00002180| 65 54 79 70 65 2c 20 26 | 61 63 74 75 61 6c 54 79 |eType, &|actualTy|
|00002190| 70 65 2c 20 28 50 74 72 | 29 20 26 65 76 65 6e 74 |pe, (Ptr|) &event|
|000021a0| 43 6c 61 73 73 2c 20 0d | 09 09 09 09 09 73 69 7a |Class, .|.....siz|
|000021b0| 65 6f 66 28 65 76 65 6e | 74 43 6c 61 73 73 29 2c |eof(even|tClass),|
|000021c0| 20 26 61 63 74 75 61 6c | 53 69 7a 65 29 29 20 21 | &actual|Size)) !|
|000021d0| 3d 20 6e 6f 45 72 72 29 | 0d 09 09 09 72 65 74 75 |= noErr)|....retu|
|000021e0| 72 6e 20 6f 65 3b 0d 09 | 09 09 09 09 09 09 0d 09 |rn oe;..|........|
|000021f0| 0d 09 69 66 20 28 28 6f | 65 20 3d 20 41 45 47 65 |..if ((o|e = AEGe|
|00002200| 74 41 74 74 72 69 62 75 | 74 65 50 74 72 28 20 20 |tAttribu|tePtr( |
|00002210| 28 41 70 70 6c 65 45 76 | 65 6e 74 2a 29 20 74 68 |(AppleEv|ent*) th|
|00002220| 65 45 76 65 6e 74 2c 20 | 6b 65 79 45 76 65 6e 74 |eEvent, |keyEvent|
|00002230| 49 44 41 74 74 72 2c 0d | 09 09 09 09 09 74 79 70 |IDAttr,.|.....typ|
|00002240| 65 54 79 70 65 2c 20 26 | 61 63 74 75 61 6c 54 79 |eType, &|actualTy|
|00002250| 70 65 2c 20 28 50 74 72 | 29 20 26 65 76 65 6e 74 |pe, (Ptr|) &event|
|00002260| 49 44 2c 20 0d 09 09 09 | 09 09 73 69 7a 65 6f 66 |ID, ....|..sizeof|
|00002270| 28 65 76 65 6e 74 49 44 | 29 2c 20 26 61 63 74 75 |(eventID|), &actu|
|00002280| 61 6c 53 69 7a 65 29 29 | 20 21 3d 20 6e 6f 45 72 |alSize))| != noEr|
|00002290| 72 29 0d 09 09 09 72 65 | 74 75 72 6e 20 6f 65 3b |r)....re|turn oe;|
|000022a0| 0d 09 09 09 09 09 09 09 | 09 09 0d 09 69 66 20 28 |........|....if (|
|000022b0| 65 76 65 6e 74 43 6c 61 | 73 73 20 3d 3d 20 6b 43 |eventCla|ss == kC|
|000022c0| 6f 72 65 45 76 65 6e 74 | 43 6c 61 73 73 29 0d 09 |oreEvent|Class)..|
|000022d0| 7b 0d 09 09 73 77 69 74 | 63 68 20 28 65 76 65 6e |{...swit|ch (even|
|000022e0| 74 49 44 29 0d 09 09 7b | 0d 09 09 63 61 73 65 20 |tID)...{|...case |
|000022f0| 6b 41 45 4f 70 65 6e 41 | 70 70 6c 69 63 61 74 69 |kAEOpenA|pplicati|
|00002300| 6f 6e 3a 0d 09 09 09 69 | 66 20 28 47 6f 74 52 65 |on:....i|f (GotRe|
|00002310| 71 75 69 72 65 64 50 61 | 72 61 6d 73 28 74 68 65 |quiredPa|rams(the|
|00002320| 45 76 65 6e 74 29 29 0d | 09 09 09 7b 0d 09 09 09 |Event)).|...{....|
|00002330| 09 2f 2f 20 67 47 6f 70 | 68 65 72 2d 3e 44 6f 43 |.// gGop|her->DoC|
|00002340| 6f 6d 6d 61 6e 64 28 20 | 63 6d 64 4e 65 77 29 3b |ommand( |cmdNew);|
|00002350| 0d 09 09 09 09 2f 2f 20 | 61 6e 41 70 70 6c 65 45 |.....// |anAppleE|
|00002360| 76 65 6e 74 2d 3e 53 65 | 74 45 72 72 6f 72 52 65 |vent->Se|tErrorRe|
|00002370| 73 75 6c 74 28 20 6e 6f | 45 72 72 29 3b 0d 09 09 |sult( no|Err);...|
|00002380| 09 09 41 73 6b 45 64 69 | 74 57 69 6e 64 6f 77 28 |..AskEdi|tWindow(|
|00002390| 29 3b 0d 09 09 09 7d 0d | 09 09 09 62 72 65 61 6b |);....}.|...break|
|000023a0| 3b 0d 09 09 09 09 0d 09 | 09 63 61 73 65 20 6b 41 |;.......|.case kA|
|000023b0| 45 4f 70 65 6e 44 6f 63 | 75 6d 65 6e 74 73 3a 0d |EOpenDoc|uments:.|
|000023c0| 09 09 09 44 6f 4f 70 65 | 6e 45 76 65 6e 74 28 20 |...DoOpe|nEvent( |
|000023d0| 74 68 65 45 76 65 6e 74 | 29 3b 0d 09 09 09 62 72 |theEvent|);....br|
|000023e0| 65 61 6b 3b 0d 09 09 09 | 09 0d 09 09 63 61 73 65 |eak;....|....case|
|000023f0| 20 6b 41 45 50 72 69 6e | 74 44 6f 63 75 6d 65 6e | kAEPrin|tDocumen|
|00002400| 74 73 3a 0d 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |ts:....b|reak;...|
|00002410| 09 0d 09 09 63 61 73 65 | 20 6b 41 45 51 75 69 74 |....case| kAEQuit|
|00002420| 41 70 70 6c 69 63 61 74 | 69 6f 6e 3a 0d 09 09 09 |Applicat|ion:....|
|00002430| 69 66 20 28 47 6f 74 52 | 65 71 75 69 72 65 64 50 |if (GotR|equiredP|
|00002440| 61 72 61 6d 73 28 74 68 | 65 45 76 65 6e 74 29 29 |arams(th|eEvent))|
|00002450| 0d 09 09 09 7b 0d 09 09 | 09 09 67 51 75 69 74 46 |....{...|..gQuitF|
|00002460| 6c 61 67 20 3d 20 74 72 | 75 65 3b 0d 09 09 09 7d |lag = tr|ue;....}|
|00002470| 0d 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 7d 09 09 |....brea|k;...}..|
|00002480| 0d 09 7d 0d 09 09 0d 09 | 72 65 74 75 72 6e 20 6e |..}.....|return n|
|00002490| 6f 45 72 72 3b 0d 7d 0d | 0d 0d 0d 76 6f 69 64 20 |oErr;.}.|...void |
|000024a0| 49 6e 69 74 41 70 70 6c | 65 45 76 65 6e 74 73 28 |InitAppl|eEvents(|
|000024b0| 76 6f 69 64 29 0d 7b 0d | 09 69 66 20 28 67 53 79 |void).{.|.if (gSy|
|000024c0| 73 37 46 6c 61 67 29 0d | 09 09 41 45 49 6e 73 74 |s7Flag).|..AEInst|
|000024d0| 61 6c 6c 45 76 65 6e 74 | 48 61 6e 64 6c 65 72 28 |allEvent|Handler(|
|000024e0| 74 79 70 65 57 69 6c 64 | 43 61 72 64 2c 20 74 79 |typeWild|Card, ty|
|000024f0| 70 65 57 69 6c 64 43 61 | 72 64 2c 0d 09 09 09 09 |peWildCa|rd,.....|
|00002500| 09 09 09 09 28 45 76 65 | 6e 74 48 61 6e 64 6c 65 |....(Eve|ntHandle|
|00002510| 72 50 72 6f 63 50 74 72 | 29 20 41 70 70 6c 65 45 |rProcPtr|) AppleE|
|00002520| 76 65 6e 74 48 61 6e 64 | 6c 65 72 2c 0d 09 09 09 |ventHand|ler,....|
|00002530| 09 09 09 09 09 30 2c 46 | 41 4c 53 45 29 3b 0d 7d |.....0,F|ALSE);.}|
|00002540| 0d 0d 76 6f 69 64 20 43 | 68 65 63 6b 45 6e 76 69 |..void C|heckEnvi|
|00002550| 72 6f 6e 6d 65 6e 74 28 | 76 6f 69 64 29 0d 7b 0d |ronment(|void).{.|
|00002560| 09 53 79 73 45 6e 76 52 | 65 63 09 73 45 6e 76 3b |.SysEnvR|ec.sEnv;|
|00002570| 0d 09 4f 53 45 72 72 09 | 09 6f 65 3b 0d 0d 09 6f |..OSErr.|.oe;...o|
|00002580| 65 20 3d 20 53 79 73 45 | 6e 76 69 72 6f 6e 73 28 |e = SysE|nvirons(|
|00002590| 31 2c 26 73 45 6e 76 29 | 3b 0d 0d 09 67 53 79 73 |1,&sEnv)|;...gSys|
|000025a0| 37 46 6c 61 67 20 3d 20 | 73 45 6e 76 2e 73 79 73 |7Flag = |sEnv.sys|
|000025b0| 74 65 6d 56 65 72 73 69 | 6f 6e 20 3e 3d 20 30 78 |temVersi|on >= 0x|
|000025c0| 30 37 30 30 3b 0d 09 67 | 43 6f 6c 6f 72 51 44 46 |0700;..g|ColorQDF|
|000025d0| 6c 61 67 20 3d 20 73 45 | 6e 76 2e 68 61 73 43 6f |lag = sE|nv.hasCo|
|000025e0| 6c 6f 72 51 44 3b 0d 7d | 0d 0d 2f 2a 20 65 6e 64 |lorQD;.}|../* end|
|000025f0| 20 45 76 74 6c 61 62 2e | 63 20 2a 2f 00 00 00 00 | Evtlab.|c */....|
|00002600| 00 00 01 00 00 00 01 cc | 00 00 00 cc 00 00 00 5a |........|.......Z|
|00002610| 00 00 05 bc 07 73 6f 75 | 72 63 65 73 01 00 00 00 |.....sou|rces....|
|00002620| 00 2a 00 00 05 db a4 f5 | 12 53 a7 e9 b2 c0 00 00 |.*......|.S......|
|00002630| 06 4d 61 69 6e 2e 63 b4 | 02 00 00 00 54 45 58 54 |.Main.c.|....TEXT|
|00002640| 4b 41 48 4c 01 00 00 34 | 01 80 00 00 00 00 88 6f |KAHL...4|.......o|
|00002650| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 34 01 80 |..TEXTKA|HL...4..|
|00002660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002670| 00 00 9e 7d 36 20 00 00 | 25 7c 00 00 02 26 4d 6f |...}6 ..|%|...&Mo|
|00002680| 6f 56 54 56 4f 44 00 00 | 00 00 00 00 00 00 00 00 |oVTVOD..|........|
|00002690| 4d eb 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |M.......|........|
|000026a0| 00 00 00 00 00 00 a7 fc | 5e 41 a7 fc 5e 41 00 00 |........|^A..^A..|
|000026b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002700| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002720| 00 00 00 00 00 00 00 06 | 00 04 00 b9 00 37 01 a8 |........|.....7..|
|00002730| 02 2e 00 b9 00 37 01 a8 | 02 2e a9 31 fc 61 00 00 |.....7..|...1.a..|
|00002740| 18 64 00 00 18 6e 00 00 | 17 98 01 00 00 00 00 7c |.d...n..|.......||
|00002750| 00 03 00 18 00 00 18 eb | 01 04 00 73 96 bc 00 00 |........|...s....|
|00002760| 09 2a 74 68 65 45 76 65 | 6e 74 00 2e 00 00 19 4d |.*theEve|nt.....M|
|00002770| 01 06 00 73 96 ac 00 00 | 1f 74 68 65 45 76 65 6e |...s....|.theEven|
|00002780| 74 2d 3e 6d 65 73 73 61 | 67 65 20 26 20 72 65 73 |t->messa|ge & res|
|00002790| 75 6d 65 46 6c 61 67 20 | 00 34 00 00 18 a9 01 02 |umeFlag |.4......|
|000027a0| 00 73 96 9c 00 00 25 28 | 74 68 65 45 76 65 6e 74 |.s....%(|theEvent|
|000027b0| 2d 3e 6d 65 73 73 61 67 | 65 20 26 20 72 65 73 75 |->messag|e & resu|
|000027c0| 6d 65 46 6c 61 67 29 20 | 3e 20 30 20 00 00 01 00 |meFlag) |> 0 ....|
|000027d0| 00 00 01 cc 00 00 00 cc | 00 00 00 5a 00 82 20 44 |........|...Z.. D|
|000027e0| 17 82 00 00 00 1c 00 46 | 00 01 4d 50 53 52 00 00 |.......F|..MPSR..|
|000027f0| 00 12 44 54 56 55 00 00 | 00 1e 03 ed 00 00 00 00 |..DTVU..|........|
|00002800| 00 00 00 00 00 00 49 2c | ff ff 00 00 00 4c 00 00 |......I,|.....L..|
|00002810| 00 00 13 43 72 65 61 74 | 65 64 20 62 79 20 43 4d |...Creat|ed by CM|
|00002820| 61 73 74 65 72 aa 00 00 | 00 00 00 00 00 00 00 00 |aster...|........|
|00002830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+